home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Audio / MPEG / IAMPDecoder.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  2.2 KB  |  80 lines

  1. /* 
  2.  *  IAMPDecoder.h
  3.  *
  4.  *  Code from
  5.  *            NekoAmp 1.3 decoder by Avery Lee
  6.  *
  7.  *  FlasKMPEG
  8.  *    Copyright (C) Alberto Vigata - January 2000
  9.  *
  10.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  11.  *    
  12.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  13.  *  it under the terms of the GNU General Public License as published by
  14.  *  the Free Software Foundation; either version 2, or (at your option)
  15.  *  any later version.
  16.  *   
  17.  *  FlasKMPEG is distributed in the hope that it will be useful,
  18.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  *  GNU General Public License for more details.
  21.  *   
  22.  *  You should have received a copy of the GNU General Public License
  23.  *  along with GNU Make; see the file COPYING.  If not, write to
  24.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  25.  *
  26.  */
  27.  
  28. #ifndef f_AMPLIB_IAMPDECODER_H
  29. #define f_AMPLIB_IAMPDECODER_H
  30.  
  31.  
  32. class AMPStreamInfo {
  33. public:
  34.     long    lBitrate;            // average bits/second for this stream (0=unconstrained)
  35.     long    lSamplingFreq;        // sampling frequency (Hz)
  36.     char    nLayer;                // MPEG audio layer (1-3)
  37.     char    nMPEGVer;            // MPEG version (1/2)
  38.     char    fStereo;            // true: stereo, false: mono
  39. };
  40.  
  41. class IAMPBitsource {
  42. public:
  43.     virtual int read(void *buffer, int bytes)=0;
  44. };
  45.  
  46. class IAMPDecoder {
  47. public:
  48.  
  49.     enum {
  50.         ERR_NONE            = 0,
  51.         ERR_EOF                = 1,
  52.         ERR_READ            = 2,
  53.         ERR_MPEG25            = 3,
  54.         ERR_LAYER1            = 4,
  55.         ERR_FREEFORM        = 5,
  56.         ERR_SYNC            = 6,
  57.         ERR_INTERNAL        = 7,
  58.         ERR_INCOMPLETEFRAME    = 8,
  59.     };
  60.  
  61.     virtual void    Destroy()=0;
  62.  
  63.     virtual char *    GetAmpVersionString()                =0;
  64.     virtual void    Init()                                =0;
  65.     virtual void    setSource(IAMPBitsource *pSource)    =0;
  66.     virtual void    setDestination(short *psDest)        =0;
  67.     virtual long    getSampleCount()                    =0;
  68.     virtual void    getStreamInfo(AMPStreamInfo *pasi)    =0;
  69.     virtual char *    getErrorString(int err)                =0;
  70.     virtual void    Reset()                                =0;
  71.     virtual void    ReadHeader()                        =0;
  72.     virtual void    PrereadFrame()                        =0;
  73.     virtual bool    DecodeFrame()                        =0;
  74. };
  75.  
  76. extern IAMPDecoder *CreateAMPDecoder();
  77.  
  78. #endif
  79.  
  80.